package com.company;

public class ReferenceCountingGC {

    private static final int _1MB= 1024*1024;

    private byte[] bigSize = new byte[4*_1MB];

    public Object instance = null;

    public static void main(String[] args) {
        ReferenceCountingGC obja = new ReferenceCountingGC();
        ReferenceCountingGC objb = new ReferenceCountingGC();
        obja.instance = objb;
        objb.instance = obja;

        obja = null;
        objb = null;

        System.gc();
    }

}

